package com.yaorange.certificate.controller.wx;

import com.yaorange.certificate.domain.NjtArea;
import com.yaorange.certificate.dto.UserRegisterRequest;
import com.yaorange.certificate.service.INjtAreaService;
import com.yaorange.certificate.service.INjtUserPerfectService;
import com.yaorange.certificate.service.INjtUserRegisterService;
import com.yaorange.certificate.service.NjtCommonService;
import com.yaorange.certificate.vo.UserInfoVo;
import com.yaorange.common.core.domain.AjaxResult;
import com.yaorange.common.core.domain.model.LoginBody;
import com.yaorange.framework.web.service.SysLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author coach tam
 * @email 327395128@qq.com
 * @values 坚持灵活 灵活坚持
 * @since 2025/4/30
 */
@RestController
@RequestMapping("/api/area")
public class NjtAreaController {

    @Autowired
    private INjtAreaService njtAreaService;

    @GetMapping("/queryListRoot")
    public AjaxResult queryListRoot() {
        List<List<NjtArea>> areaList = njtAreaService.queryListRoot();
        return AjaxResult.success(areaList);
    }

    @GetMapping("/queryChildrenByParentCode")
    public AjaxResult queryChildrenByParentCode(@RequestParam(value = "parentCode") String parentCode) {
        List<NjtArea> areaList = njtAreaService.selectListByParentCode(parentCode);
        return AjaxResult.success(areaList);
    }

}
